<?php
/**
 * @author tungck
 * @filesource chamcong.php
 * quan ly cham cong
*/

class luongthuong extends CI_Controller{
    
    protected $mahoso;
    
    function __construct(){
        parent::__construct();
        $this->load->helper('url');
        $this->load->library(array('form_validation','session'));
        $this->load->library('userlayout');
        $this->userlayout->setLayout("user/layout");
        
        $userSession = $this->session->userdata('user');
        if($userSession['username'] == false){
            redirect(base_url('/index/login?returnUrl=').urlencode(RETURN_URL));
            
        }
        $this->mahoso = $userSession['MaHoSo'];
    }
    
    
    
    function danh_sach_luong_thuong(){
        $currTemp = array('&nbsp;&nbsp; Lương thưởng');
        $current['current'] = $currTemp;
        $title = "Lương thưởng";
        $this->userlayout->view("user/luongthuong",null ,$title, $current);
                
    }
    
    function get_danh_sach_luong_thuong(){
        $data['MaHoSo'] = $this->mahoso;
        $data['sort'] = $_GET["jtSorting"];
        $data['startIndex'] = $_GET["jtStartIndex"];
        $data['pageSize'] = $_GET["jtPageSize"];
        
        $this->load->model("user/luongthuong_model");
        $result = $this->luongthuong_model->getList($data);
        $jTableResult = array();
		$jTableResult['Result'] = "OK";
        $jTableResult['TotalRecordCount'] = $result['recordCount'];
		$jTableResult['Records'] = $result['query'];
        $this->session->set_userdata('result1', json_encode($jTableResult));
		print json_encode($jTableResult);
        
    }
    
}

?>